<template>
<div class="store">
  <p>
    {{$store.state.count}}
  </p>
  <p>

      {{$store.state.name}}
  </p>
  <button @click="increase"><strong>+</strong></button>
  <button @click="decrease"><strong>-</strong></button>
  <hr>
  <h3>{{$store.state.show}}</h3>
  <input
    placeholder="请输入内容"
    v-model="obj"
    @change="changObj"
    clearable>
  </input>
</div>
</template>
<script>
export default {
  data () {
    return {
      obj: ''
    }
  },
  methods: {
    increase() {
      this.$store.commit('increment')
    },
    decrease() {
      this.$store.commit('decrement')
    },
    changObj () {
      this.$store.commit('changVal', this.obj)
    }
  }
}

</script>
